#include "StdAfx.h"
#include "HwTreeData.h"


CHwTreeData::CHwTreeData(void)
{
	m_nDeviceParamsCount = 0;
	memset(m_pDeviceParams, 0, sizeof(m_pDeviceParams));
	//m_pDeviceParams[m_nDeviceParamsCount++] = &g_Device;
}


CHwTreeData::~CHwTreeData(void)
{
}

void CHwTreeData::AddDeviceParams(ParamItem deviceParams[], int count)
{
	for(int i = 0; i < count; i++)
	{
		ASSERT(m_nDeviceParamsCount < MAX_DEVICE_PARAM);
		m_pDeviceParams[m_nDeviceParamsCount++] = &deviceParams[i];
	}
}

ParamItem* CHwTreeData::FindDeviceParam(WCHAR* pString)
{
	for(int i = 0; i < MAX_DEVICE_PARAM; i++)
	{
		if(m_pDeviceParams[i])
		{
			if(wcscmp(m_pDeviceParams[i]->m_pName, pString) == 0)
			{
				return m_pDeviceParams[i];
			}
		}
		else
		{
			break;
		}
	}
	return NULL;
}